package shovelsoft.btmetaparser.tokens;

/***
 * An End Token marks the end of a List or Dictionary structure
 * @author cds
 */
public class End implements IToken {

	/***
	 * End is a state-less token, only one instance required
	 */
	private static final End singleton = new End();
	
	/***
	 * Get access to an End instance.
	 */
	public static End getInstance() {
		return singleton;
	}
	
	/***
	 * Private constructor, End is state-less, see getInstance();
	 */
	private End() {
	}

	/***
	 * Accept a visit from a token parser (double dispatch)
	 * @param tp Token Parser
	 */
	@Override
	public void accept(ITokenParser tp) {
		
		tp.visit(this);
	}
	
	@Override
	public String toString() {
		
		return "}";
	}
}
